use ie_draw;
alter table template add auto_audit int(1)  not null default 1  comment '是否自动审核,默认1为自动审核' after type;

use ie_procedure;
alter table task_record add created_by_name varchar(255)  null comment '创建人名称' after created_by;

DROP TABLE IF EXISTS `file_history`;
CREATE TABLE `file_history` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `file_name` varchar(255) NOT NULL COMMENT '文件名',
  `date` date NOT NULL COMMENT '日期',
  `status` int(11) NOT NULL DEFAULT '1' COMMENT '状态字段默认成功，0：失败，1：成功，2：未知',
  `del_flag` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除标志',
  `created_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` varchar(255) DEFAULT NULL COMMENT '最后修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `version` bigint(20) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件历史信息表，调度任务完成历史';




use ie_user;
update user set user_name = 'sysAdmin'  where id = 1;

-- 20210608 权限功能
use ie_draw;
alter table template add created_by varchar(255)  null comment '创建人登录账号' after is_del;
alter table template add created_by_name varchar(255)  null comment '创建人名称' after created_by;
alter table template add updated_by varchar(255)  null comment '创建人名称' after created_time;

use ie_procedure;
alter table task_record drop created_by;
alter table task_record add created_by varchar(255)  null comment '创建人登录账号' after is_del;
alter table task_record drop updated_by;
alter table task_record add updated_by varchar(255)  null comment '创建人登录账号' after created_by_name;

use ie_user;
begin;
INSERT INTO `privileges` VALUES (162, 2, 0, '缴款通知书', '41', '', NULL, 0, 0, NULL);
INSERT INTO `privileges` VALUES (163, 2, 0, '新股缴款公告', 'r-12', '', NULL, 0, 0, NULL);
INSERT INTO `privileges` VALUES (164, 2, 0, '资产管理合同', '11', '', NULL, 0, 0, NULL);
INSERT INTO `privileges` VALUES (165, 2, 0, '追加&提取通知书', '34', '', NULL, 0, 0, NULL);

INSERT INTO `roles` VALUES (21,'基金运营部', '基金运营部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (22,'运营服务部', '运营服务部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (23,'基金运营部', '基金运营部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (24,'基金运营部', '基金运营部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (25,'机构综合服务部', '机构综合服务部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (26,'基金运营部', '基金运营部', 0, 1, 0, now(), 1, null, null);
INSERT INTO `roles` VALUES (27,'所有场景权限', '所有场景权限', 0, 1, 0, now(), 1, null, null);

INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 23, 164, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 24, 162, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 24, 163, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 24, 164, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 24, 165, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 25, 164, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 162, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 163, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 164, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 165, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 162, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 163, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 164, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 165, 0, now(), 1, NULL, NULL);

delete from user_role where user_id = 101;
INSERT INTO `user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 101, 27, now(), NULL, 0);
commit;

-- 20210616
use ie_draw;
alter table element add parent_ele_sn bigint(20) not null default 0 comment '对应主场景要素id。' after ele_sn;

use ie_review;
alter table review_content add parent_ele_id varchar(255) not null default 0 comment '对应主场景id。' after ele_id;


-- 20210621 
use ie_procedure;
DROP TABLE IF EXISTS `product_task`;
CREATE TABLE `product_task` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `task_name` varchar(255) NOT NULL COMMENT '任务名称-文件名',
  `task_sn` varchar(255)  NULL COMMENT '子场景任务id',
  `template_id` varchar(255) NOT NULL COMMENT '子场景id',
  `template_name` varchar(255)  NULL COMMENT '子场景名称',
  `status` int(11) NOT NULL  default 0 COMMENT '任务状态，0-未完成 1-已完成',
  `del_flag` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除标志',
  `created_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` varchar(255) DEFAULT NULL COMMENT '最后修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `version` bigint(20) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='产品合同任务表';

use turing_job;
INSERT INTO `xxl_job_info` VALUES ( 3, '复制产品合同主场景抽取结果', '2021-06-22 14:47:47', '2021-06-22 14:47:47', 'lcy', '', 'FIX_RATE', '5', 'DO_NOTHING', 'ROUND', 'copyProductTaskJob', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2021-06-22 14:47:47', '', 1, 0, 0);

-- 20210705
use ie_procedure;
alter table task_record add first_reviewer_name varchar(255)  null comment '第一次审核人名称' after first_reviewer;

-- 20210712
use ie_user;
INSERT INTO `ie_user`.`user` VALUES (102, 0, '孙经宇', 'b2af985e52f6acdcb3bfd8134a99ad04', 8, '', '', '', '', '0', 'sunjingyu', 0, now(), 1, now(), 102, 'sunjingyu', '');
INSERT INTO `ie_user`.`user` VALUES (103, 0, '叶晓雯', 'd10341753596ccf31398b56e9b81dd53', 8, '', '', '', '', '0', 'yexiaowen', 0, now(), 1, now(), 103, 'yexiaowen', '');
INSERT INTO `ie_user`.`user` VALUES (104, 0, '杜敦耀', 'c8446281e348f8458de2cf5efebd05eb', 8, '', '', '', '', '0', 'dudunyao', 0, now(), 1, now(), 104, 'dudunyao', '');
INSERT INTO `ie_user`.`user` VALUES (105, 0, '毛婷', 'f452d091a8dbcb5c81f19480eadf13eb', 8, '', '', '', '', '0', 'maoting', 0, now(), 1, now(), 105, 'maoting', '');
INSERT INTO `ie_user`.`user` VALUES (106, 0, '黎单', '1705402990b41dc5344767a96dd80c71', 8, '', '', '', '', '0', 'lidan', 0, now(), 1, now(), 106, 'lidan', '');
INSERT INTO `ie_user`.`user` VALUES (107, 0, '雷钰婷', 'f7b0e274adc10f6ea120c9e7b9406e3e', 8, '', '', '', '', '0', 'leiyuting', 0, now(), 1, now(), 107, 'leiyuting', '');
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 102, 21, now(), NULL, 0);
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 103, 22, now(), NULL, 0);
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 104, 23, now(), NULL, 0);
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 105, 24, now(), NULL, 0);
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 106, 25, now(), NULL, 0);
INSERT INTO `ie_user`.`user_role`(user_id,role_id,created_time,update_time,status) VALUES ( 107, 26, now(), NULL, 0);

-- 20210719
use ie_user;
INSERT INTO `privileges` VALUES (166, 2, 0, '银行理财', '46', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 22, 166, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 166, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 166, 0, now(), 1, NULL, NULL);

-- 20210721
use ie_user;
INSERT INTO `privileges` VALUES (167, 2, 0, 'TA理财', '50', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 22, 167, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 167, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 167, 0, now(), 1, NULL, NULL);


-- 20210810
use ie_review;
DROP TABLE IF EXISTS `export_info`;
CREATE TABLE `export_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `template_id` varchar(255) NOT NULL COMMENT '场景id',
  `type` int(11) NOT NULL default 0 COMMENT '0-根据要素字段导出，1-根据场景id再匹配数据库',
  `title` varchar(255)  NULL COMMENT '标题，如果分组需要多个标题通过,分开',
  `file_name` varchar(255)  NULL COMMENT '导出文件名--默认是场景名称,主要是针对多条场景导出，如果是分组需要通过,分开',
  `del_flag` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除标志',
  `created_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` varchar(255) DEFAULT NULL COMMENT '最后修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `version` bigint(20) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='导出基础表，记录各个场景的导出类型';

INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '11', 0, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 1, '申购,赎回', '申购,赎回', 0, NULL, now(), NULL, NULL, 0);


DROP TABLE IF EXISTS `export_field`;
CREATE TABLE `export_field` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `template_id` varchar(255) NOT NULL COMMENT '场景id',
  `filed_map` varchar(255) NULL COMMENT '字段属性',
  `field_name` varchar(255) NOT NULL COMMENT '字段名称',
  `width` int(11) NOT NULL default 20 COMMENT '宽度',
  `export_group` int(11) NOT NULL default 1 COMMENT '分组默认只有一个，如果导出包含多个文本，通过分组筛选',
  `arguments` varchar(1024) COMMENT '其它参数，通过该字段配置',
  `del_flag` int(11) NOT NULL DEFAULT '0' COMMENT '逻辑删除标志',
  `created_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_by` varchar(255) DEFAULT NULL COMMENT '最后修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '最后修改时间',
  `version` bigint(20) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='导出字段映射表';


-- 缴款
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'PaymentDate', '缴款日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'BondName', '债券名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'Code', '债券代码', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'PaymentAmount', '缴款金额（元）-小写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'AccountName', '开户/账户名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'BankAccount', '银行账号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'AccountBank', '开户银行', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '41', 'PaymentCode', '大额支付行号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
-- 新股
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '资产组合-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '股东账户-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '证券代码-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '中签数量（股）-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '中签金额（元）-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '佣金（元）-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( 'r-12', 'Unit', '总金额（元）-公告', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
-- 追加提取
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'AdditionOrWithdrawal', '追加或提取', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'AmountInWords', '金额大写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'AmountInFigures', '金额小写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'Date', '日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'AccountId', '账号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'AccountName', '户名', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'Bank', '开户行', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', 'LargeAmountPaymentNo', '大额支付号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', null, '份额大写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', null, '份额小写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', null, '托管费', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '34', null, '管理费', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
-- 银行理财
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'ProductCode', '理财产品代码', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'Date', '日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'BussinessType', '业务类别', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'Share', '份额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'Amount', '成交金额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '费用', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '利息', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', 'ConfirmDate', '确认日期/截止日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '是否结转收益', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '交易对手', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '资金账户', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '46', null, '赎回类型', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);

-- TA理财
-- 申购
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '基金代码', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '销售日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '确认日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'BuyCount', '申购份额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'BuyAmount', '申购金额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '机构', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '退出日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
-- 赎回
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'ProductName', '产品名称', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '基金代码', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '销售日期', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'ConfirmDate', '确认日期', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'RansomCount', '赎回份额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', 'RansomAmount', '赎回金额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '机构赎回费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '归基金赎回费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '后端申购费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '业绩提成金额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '赎回收益', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '机构', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '50', null, '浮动投资顾问费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);


-- 20210816
-- 基金确认单
use ie_user;
INSERT INTO `privileges` VALUES (168, 2, 0, '基金确认单', '37', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 168, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 168, 0, now(), 1, NULL, NULL);

use ie_draw;
INSERT INTO `ie_draw`.`template`(`template_sn`, `template_name`, `privilege`, `type`, `needs_json`, `is_del`, `created_by`, `created_by_name`, `created_time`, `updated_by`, `updated_time`, `auto_audit`) VALUES ('37', '基金确认单', 0, '0', 0, 0, NULL, NULL, '2020-11-05 12:50:20', NULL, NULL, 0);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (11485, 0, 'CustomerName', '37', '客户名称', '多项', '字符串', 1, 0, '55', 1, 0, '2020-11-05 12:52:33', '2020-11-05 12:52:46');

-- 基金确认单导出
use ie_review;
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '37', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '37', 'CustomerName', '客户名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);

-- 修改主键自增值
use ie_draw;
alter table element AUTO_INCREMENT= 30000;


-- 20210823
-- 基金申购通知书
use ie_draw;
INSERT INTO `ie_draw`.`template`(`template_sn`, `template_name`, `privilege`, `type`, `needs_json`, `is_del`, `created_by`, `created_by_name`, `created_time`, `updated_by`, `updated_time`, `auto_audit`) VALUES ('52', '基金申购通知书', 0, '0', 1, 0, NULL, NULL, '2021-08-17 11:12:32', NULL, NULL, 0);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13667, 0, 'ProductName', '52', '产品名称', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:22:47', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13668, 0, 'TargetBondName', '52', '标的基金名称', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:25:41', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13669, 0, 'TargetBondCode', '52', '标的基金代码', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:29:59', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13670, 0, 'ApplyAmountLowercase', '52', '申请金额小写（元）', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:30:01', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13671, 0, 'ApplyAmountUppercase', '52', '申请金额大写', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:30:04', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13672, 0, 'TransactionDate', '52', '交易日期', '多项', '字符串', 1, 1, '55', 1, 0, '2021-08-17 11:30:07', NULL);
-- 基金申购通知书权限
-- 授权
use ie_user;
INSERT INTO `privileges` VALUES (169, 2, 0, '基金申购通知书', '52', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 24, 169, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 169, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 169, 0, now(), 1, NULL, NULL);


-- 基金申购通知书导出
use ie_review;
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'TargetBondName', '标的基金名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'TargetBondCode', '标的基金代码', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'ApplyAmountLowercase', '申请金额小写（元）', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'ApplyAmountUppercase', '申请金额大写', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '52', 'TransactionDate', '交易日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);


-- 20210924 托管户
use ie_draw;
INSERT INTO `ie_draw`.`template`(`template_sn`, `template_name`, `privilege`, `type`, `needs_json`, `is_del`, `created_by`, `created_by_name`, `created_time`, `updated_by`, `updated_time`, `auto_audit`) VALUES ('53', '账户要素-托管户', 0, '0', 1, 0, NULL, NULL, '2021-08-17 11:14:15', NULL, NULL, 0);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13674, 0, 'ProductName', '53', '产品名称', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13675, 0, 'AccountName', '53', '托管户账户名称', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13676, 0, 'AccountNumber', '53', '托管户账号', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13677, 0, 'AccountPayNumber', '53', '托管户开户行大额支付行号', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13678, 0, 'AccountOpenDate', '53', '托管户开户日期', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13679, 0, 'AccountOpenBank', '53', '托管户开户行', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13680, 0, 'AccountProvince', '53', '托管户开户行所在省份', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13681, 0, 'AccountCity', '53', '托管户开户行所在城市', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13682, 0, 'AccountRate', '53', '托管户利率', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13683, 0, 'AccountInDate', '53', '账户可进款日', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13684, 0, 'AccountOutDate', '53', '账户可出款日', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13685, 0, 'FundRateStartDate', '53', '存款利率起息日', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13686, 0, 'FundRateEndDate', '53', '存款利率到期日', '多项', '字符串', 1, 1, '55', 1, 0, NULL, NULL);
-- 关联字段
use ie_draw;
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13674, 13675);
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13681, 13679);
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13680, 13679);
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13683, 13678);
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13684, 13678);
INSERT INTO `element_relations`(`ele_sn`, `related_ele_sn`) VALUES (13685, 13678);

-- 授权
use ie_user;
INSERT INTO `privileges` VALUES (170, 2, 0, '托管户', '53', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 23, 170, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 170, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 170, 0, now(), 1, NULL, NULL);

-- 托管户导出
INSERT INTO `ie_review`.`export_info`( `template_id`, `type`, `title`, `file_name`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 1, NULL, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountName', '托管户账户名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountNumber', '托管户账号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountPayNumber', '托管户开户行大额支付行号', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountOpenDate', '托管户开户日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountOpenBank', '托管户开户行', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountProvince', '托管户开户行所在省份', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountCity', '托管户开户行所在城市', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountRate', '托管户利率', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountInDate', '账户可进款日', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'AccountOutDate', '账户可出款日', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'FundRateStartDate', '存款利率起息日', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '53', 'FundRateEndDate', '存款利率到期日', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);


-- 20210823 增加TA海峡场景
use ie_draw;
INSERT INTO `ie_draw`.`template`(`template_sn`, `template_name`, `privilege`, `type`, `needs_json`, `is_del`, `created_by`, `created_by_name`, `created_time`, `updated_by`, `updated_time`, `auto_audit`) VALUES ('51', 'TA海峡', 0, '0', 1, 0, NULL, NULL, '2021-06-22 17:26:34', NULL, '2021-06-25 17:50:30', 0);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13693, 0, 'ProductName', '51', '产品名称', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:45', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13694, 0, 'ConfirmDate', '51', '确认日期', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:47', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13695, 0, 'RansomAmount', '51', '赎回金额', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:49', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13696, 0, 'RansomCount', '51', '赎回份额', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:50', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13697, 0, 'BuyAmount', '51', '申购金额', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:52', NULL);
INSERT INTO `ie_draw`.`element`(`ele_sn`, `parent_ele_sn`, `map_name`, `template_sn`, `ele_name`, `ele_type`, `ele_category_ch`, `counted`, `needs_json`, `package_sn`, `selected`, `is_del`, `created_time`, `updated_time`) VALUES (13698, 0, 'BuyCount', '51', '申购份额', '多项', '字符串', 1, 1, '55', 1, 0, '2021-06-22 17:27:53', NULL);

-- 授权
use ie_user;
INSERT INTO `privileges` VALUES (168, 2, 0, 'TA海峡', '51', '', NULL, 0, 0, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 22, 168, 0, now(), 1, NULL, NULL);
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 26, 168, 0, now(), 1, NULL, NULL);
-- 生产不执行
INSERT INTO `role_privileges`(role_id,privilege_id,is_del,created_time,created_by,updated_time,updated_by) VALUES ( 27, 168, 0, now(), 1, NULL, NULL);

-- TA海峡导出
-- 申购
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'ProductName', '产品名称', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '基金代码', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '销售日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '确认日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'BuyCount', '申购份额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'BuyAmount', '申购金额', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '机构', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '退出日期', 20, 1, NULL, 0, NULL, now(), NULL, NULL, 0);
-- 赎回
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'ProductName', '产品名称', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '基金代码', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '销售日期', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'ConfirmDate', '确认日期', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'RansomCount', '赎回份额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', 'RansomAmount', '赎回金额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '机构赎回费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '归基金赎回费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '后端申购费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '业绩提成金额', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '赎回收益', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '机构', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);
INSERT INTO `ie_review`.`export_field`( `template_id`, `filed_map`, `field_name`, `width`, `export_group`, `arguments`, `del_flag`, `created_by`, `created_time`, `updated_by`, `updated_time`, `version`) VALUES ( '51', null, '浮动投资顾问费', 20, 2, NULL, 0, NULL, now(), NULL, NULL, 0);



